<template>
    <section class="secretary-ganbu">
        <el-tabs type="border-card"  v-model="activeName">
            <el-tab-pane label="任务发布" name="releaseTask" v-if="user.roleCode === 'CITY_LEADER'">
                <SecretaryTaskRelease v-if="activeName==='releaseTask'" :releaseType="'村干部信息更新'"></SecretaryTaskRelease>
            </el-tab-pane>
            <el-tab-pane label="信息审核" name="cityVerify" v-if="user.roleCode === 'CITY_LEADER'">
                <VillageVerify v-if="activeName==='cityVerify'"></VillageVerify>
            </el-tab-pane>
            <el-tab-pane label="信息编辑" name="editInfo" v-if="user.roleCode === 'COUNTRY_SIDE_ACTOR'">
                <VillageDetail v-if="activeName==='editInfo'"  :isEdit="true"></VillageDetail>
            </el-tab-pane>
            <el-tab-pane label="信息审核" name="verifyInfo" v-if="user.roleCode === 'TOWN_REVIEWER'">
                <VillageVerify v-if="activeName==='verifyInfo'"></VillageVerify>
            </el-tab-pane>
            <el-tab-pane label="信息查看" name="baseInfo">
                <VillageDetail v-if="activeName==='baseInfo'"  :isEdit="false"></VillageDetail>
            </el-tab-pane>
            <el-tab-pane label="信息统计" name="villageStatistics" v-if="user.roleCode !== 'COUNTRY_SIDE_ACTOR'">
                <VillageStatistics v-if="activeName==='villageStatistics'"></VillageStatistics>
            </el-tab-pane>
           <!-- <el-tab-pane label="岗位管理" name="postInfo" >
                <VillageChange v-if="activeName==='postInfo'"></VillageChange>
            </el-tab-pane>-->
        </el-tabs>
    </section>
</template>

<script>
    import VillageDetail from "@/components/village/VillageDetail";
    import VillageEdit from "@/components/village/VillageEdit";
    import VillageVerify from "@/components/village/VillageVerify";
    import VillageChange from "@/components/village/VillageChange";
    import CityVerify from "../../components/CityVerify";
    import VillageCadresActive from "../../components/VillageCadresActive";
    import SecretaryTaskRelease from "@/components/SecretaryTaskRelease";
    import VillageStatistics from "@/components/village/VillageStatistics";

    export default {
        name: "VillageCadres",
        data(){
            return {
                user:{},
                activeName:'releaseTask'
            }
        },
        methods:{
        },
        components: {
            VillageDetail,
            VillageEdit,
            VillageVerify,
            VillageChange,
            SecretaryTaskRelease,
            CityVerify,
            VillageCadresActive,
            VillageStatistics
        },
        created(){
            this.user = JSON.parse(sessionStorage.getItem('userInfo'));
            if(this.user.roleCode==='CITY_LEADER'){
                this.activeName = 'releaseTask';
            }else if(this.user.roleCode==='TOWN_REVIEWER'){
                this.activeName = 'verifyInfo';
            }else {
                this.activeName = 'editInfo';
            }
        }
    }
</script>

<style>
    .secretary-ganbu .el-tag {
        height: 40px;
        font-size: 16px;
        line-height: 40px;
    }
    .secretary-ganbu .el-tabs {
        background: transparent;
        box-shadow: none;
        margin-right: 15px;
    }
    .secretary-ganbu .el-tab-pane {
        min-height: 700px;
    }
</style>

